package cn.demomaster.quickui_sample.ui.fragment.component;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import android.widget.VideoView;

import cn.demomaster.quickrouter.fragment.QuickFragment;
import cn.demomaster.quickui.annotation.ActivityPager;
import cn.demomaster.quickui.annotation.ResType;
import cn.demomaster.quickui_sample.R;
@ActivityPager(name = "视频播放", preViewClass = TextView.class, resType = ResType.Resource)//,iconRes = R.drawable.ic_video)
public class VideoActivity extends QuickFragment {
    VideoView qdVideo;
//    @Override
//    protected void onCreate(Bundle savedInstanceState) {
//        super.onCreate(savedInstanceState);
//        setContentView(R.layout.activity_video);
//    }

    @Override
    public View onGenerateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View mView = inflater.inflate(R.layout.activity_video, null);
        return mView;
    }

    @Override
    public void initView(View rootView) {
        qdVideo = findViewById(R.id.video_view);
        qdVideo.setVideoPath("https://test-1300398639.cos.ap-beijing.myqcloud.com/%E7%AB%96%E5%B1%8F4K.mp4?q-sign-algorithm=sha1&q-ak=AKID25Mn7ukHh4dkBkpKFmHve2WHd4Yz5Fwa&q-sign-time=1699928119;1699935319&q-key-time=1699928119;1699935319&q-header-list=&q-url-param-list=&q-signature=5f92bb0736f59e8f38ce6efaf52d885f8514f62b&x-cos-security-token=a99b749a82a3f2d49c4f30a04b918a556c735ff920001");
        qdVideo.start();
    }
}